<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script type="text/javascript">
			var s = new String("tom");
			s = "marry"
			
			var c = s.charAt(1);
			console.log(c);
			
			var cs = s.substr(1,3);
			console.log(cs);
			
			cs = s.substring(1,5);
			console.log(cs);
			
			var n = s.indexOf("r");
			console.log(n);
			
			var m = s.lastIndexOf("r");
			console.log(m);
			
			s = s.replace("rr","wocao"); 
			console.log(s);
			
			s = s.toUpperCase();
			console.log(s);
			
			s = s.toLowerCase();
			console.log(s);
			
			
		</script>
	</head>
	<body>
	</body>
</html>
